package com.ekuaitu.kuaitu.adapter;

import android.content.Context;

import com.ekuaitu.kuaitu.R;
import com.ekuaitu.kuaitu.base.BaseRcAdapterHelper;
import com.ekuaitu.kuaitu.base.RcQuickAdapter;
import com.ekuaitu.kuaitu.bean.AccountBean;

/**
 * Created by Michael Pi on 2016/9/29.
 */
public class ChargeValueAdapter extends RcQuickAdapter<AccountBean.AttachmentBean.RechargeModelBean> {
    public ChargeValueAdapter(Context context, int layoutResId) {
        super(context, layoutResId);
    }

    @Override
    protected void convert(BaseRcAdapterHelper helper, AccountBean.AttachmentBean.RechargeModelBean item) {

        helper.setText(R.id.item_charge_value, (int) (item.getRechargePrice()) + "元");
        if (item.getRemarks() != null && !item.getRemarks().equals("")) {
            helper.setText(R.id.item_charge_present, item.getRemarks());
        } else {
            helper.setVisible(R.id.item_charge_present, false);
        }
        if (item.isChecked()) {
            helper.setBackgroundRes(R.id.item_charge_layout,  R.color.orange);
            helper.setTextColorRes(R.id.item_charge_value, R.color.white);
            helper.setTextColorRes(R.id.item_charge_present, R.color.white);
             /*helper.setTextColorRes(R.id.item_charge_before, R.color.white);
            helper.setTextColorRes(R.id.item_charge_after, R.color.white);*/
        } else {
            helper.setBackgroundRes(R.id.item_charge_layout, R.color.white);
            helper.setTextColorRes(R.id.item_charge_value, R.color.black1);
            helper.setTextColorRes(R.id.item_charge_present, R.color.black1);
              /* helper.setTextColorRes(R.id.item_charge_before, R.color.colorPrimary);
            helper.setTextColorRes(R.id.item_charge_after, R.color.colorPrimary);*/

        }

    }
}
